import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralCalendarInfo = (params) => {
  params.head.transCode = 'queryGeneralCalendarInfo';
  return request({
    url: '/general/generalCalendarInfo/queryGeneralCalendarInfo',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralCalendarInfoListPage = (params) => {
  params.head.transCode = 'queryGeneralCalendarInfoListPage';
  return request({
    url: '/general/generalCalendarInfo/queryGeneralCalendarInfoListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralCalendarInfo = (params) => {
  params.head.transCode = 'saveGeneralCalendarInfo';
  return request({
    url: '/general/generalCalendarInfo/saveGeneralCalendarInfo',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralCalendarInfoList = (params) => {
  params.head.transCode = 'saveGeneralCalendarInfoList';
  return request({
    url: '/general/generalCalendarInfo/saveGeneralCalendarInfoList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralCalendarInfo = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralCalendarInfo';
  return request({
    url: '/general/generalCalendarInfo/saveOrUpdateGeneralCalendarInfo',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralCalendarInfoList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralCalendarInfoList';
  return request({
    url: '/general/generalCalendarInfo/saveOrUpdateGeneralCalendarInfoList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralCalendarInfo = (params) => {
  params.head.transCode = 'updateGeneralCalendarInfo';
  return request({
    url: '/general/generalCalendarInfo/updateGeneralCalendarInfo',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralCalendarInfo = (params) => {
  params.head.transCode = 'deleteGeneralCalendarInfo';
  return request({
    url: '/general/generalCalendarInfo/deleteGeneralCalendarInfo',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralCalendarInfoList = (params) => {
  params.head.transCode = 'deleteGeneralCalendarInfoList';
  return request({
    url: '/general/generalCalendarInfo/deleteGeneralCalendarInfoList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralCalendarInfoExcel = (params) => {
  downloadExcel({
    url: '/general/generalCalendarInfo/excelDownload/exportGeneralCalendarInfoExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
//查询用户有权限的日历列表
export const queryPermCalendarList = (params) => {
  params.head.transCode = 'queryPermCalendarList';
  return request({
    url: '/general/generalCalendarInfo/queryPermCalendarList',
    method: 'post',
    data: params
  })
}